#include "stdafx.h"
#include "Point.h"
#include "Triangle.h"

void Point::addTriangle(Triangle *triangle){
	triangles.push_back(triangle);
}

void Point::calculateNormal(){
	normal = vector3(0, 0, 0);
	for (std::vector<Triangle *>::iterator iter = triangles.begin(); iter != triangles.end(); iter++){
		normal += (*iter)->getNormal();
	}
	normal /= triangles.size();
}